/*
 * anima/common/acpi.hh - Common interface for locating ACPI tables.
 * Copyright (C) 2007  Mikhail Vorozhtsov
 * See the LICENSE section of the README file for details.
 */

/* $Id$ */

#ifndef HEADER_ANIMA_COMMON_ACPI_HH
#define HEADER_ANIMA_COMMON_ACPI_HH

#include HEADER (acpi,tables.hh)

START_NAMESPACE2 (anima,common)

class acpi
{
private:
  static const ::acpi::rsdp_t *rsdp;

public:
  static bool init (u64_t start, u64_t end = 0);

public:
  INLINE
  static const ::acpi::rsdp_t *
  get_rsdp ()
  {
    return rsdp;
  }

  static bool find (u32_t sig, const ::acpi::sdt_t *&tbl);

  template <typename T>
  INLINE
  static bool find (const T *&tbl)
  {
    return find (T::SIG, (const ::acpi::sdt_t *&) tbl);
  }
};

END_NAMESPACE2

#endif /* HEADER_ANIMA_COMMON_ACPI_HH */

